<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="doOpen()">打开</button>
</body>
<script>
    let resWindow;
    
    /**
     * 点击开发按钮执行的方法
     */
    function doOpen() {
        resWindow = document.open("https://www.baidu.com",'', '');

        // 以上代码等同于
        // resWindow = window.open("http://www.baidu.com");
    }
</script>
</html>